//
//  UIViewController+ShowActionSheet_PACK.m
//  dyss_v2
//
//  Created by LXF on 16/1/30.
//  Copyright © 2016年 First Facility. All rights reserved.
//

#import "UIViewController+ShowActionSheet_PACK.h"

#import "TYAlertController.h"
#import "XXAlertAction.h"

@implementation UIViewController (ShowActionSheet_PACK)

- (void)showActionSheetWithTitle:(NSString *)title message:(NSString *)message  addAlertActionBlock:(addAlertActionBlock)addBlock{
    
    TYAlertView *alertView = [TYAlertView alertViewWithTitle:@"TYAlertView" message:@"This is a message, the alert view style is actionsheet. "];
    
    NSMutableArray<XXAlertAction *> *arrayM = [NSMutableArray array];
    
    addBlock(arrayM);
    
    for (XXAlertAction *action in arrayM) {
        [alertView addAction:action];
    }
    
    TYAlertController *alertController = [TYAlertController alertControllerWithAlertView:alertView preferredStyle:TYAlertControllerStyleActionSheet];
    [self presentViewController:alertController animated:YES completion:nil];
}

@end
